﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using NoodlesCms.Configuration;
using Noodles.Core.Repositories;
using Noodles.Core.Model;


namespace NoodlesCms.Controllers
{
    public class PagesController : Controller
    {
        //
        // GET: /Pages/
        public INoodlesRepository noodlesRepo { get; set; }
        public ActionResult Index(string page)
        {
            string normalpage = page.Replace('-', ' ');
            var blogs = noodlesRepo.GetPagedBlog(normalpage,1,5);
            return View(blogs);      
        }
        [SEOToId]
        public ActionResult Details(int id, string Title)
        {
            IEnumerable<BlogPost> post = noodlesRepo.GetBlogFromTitle(Title);            
            return View(post);
        }
    }
}
